#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<string>

using namespace std;

void LuckyNumber()
{
	long long ans = 0;
	for (int i = 11; i < 100000000; i++)
	{
		string str = to_string(i);
		if (str.size() % 2 != 0)
		{
			continue;
		}
		int leng = str.size();
		int left = 0, right = 0;
		for (int j = 0; j < leng; j++)
		{
			int num = str[j] - '0';
			if (j < leng / 2)
			{
				left += num;
			}
			else
			{
				right += num;
			}
		}
		if (left == right)
		{
			ans++;
		}
	}
	cout << ans << endl;
}

int main()
{
	LuckyNumber();
	return 0;
}